<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
</head>
<body>
获取request 属性值<br>
<p th:text="${#httpServletRequest.getAttribute('requestMessage')}"/>
<p th:text="'requestMessage = ' + ${requestMessage}"/>
<p th:text="${#httpServletRequest.getServletContext().getRealPath('/')}"/>
获取session 属性值<br>
<p th:text="${#httpSession.getAttribute('sessionMessage')}"/>
<p th:text="'sessionMessage = ' + ${session.sessionMessage}"/>
<hr/>
<p th:text="${url}"/>
获取应用程序/ servlet上下文属性<br>
<p th:text="${#httpServletRequest.getServletContext().getAttribute('applicationMessage')}"/>
<p th:text="'applicationMessage = ' + ${application.applicationMessage}"/>
</body>
</html>